package test.myorm;

import java.util.HashMap;
import java.util.Map;

import jodd.bean.BeanUtilBean;

public class App2 {

	public static void main(String[] args) {
		BeanUtilBean bub = new BeanUtilBean();
		User user = new User();
//		user.setAge(0);
		boolean flag = bub.hasProperty(user, "age");
		System.out.println(flag);
		
		Map map = new HashMap();
//		map.put("age", 10);
		flag = bub.hasProperty(map, "age");
		System.out.println(flag);
		System.out.println(HashMap.class.isAssignableFrom(Map.class));
		System.out.println(Map.class.isAssignableFrom(HashMap.class));
		bub.setProperty(user, "bbb", "aaa");
		bub.setProperty(map, "bbb", "aaa");
		System.out.println(user);
		System.out.println(map);
	}
	
	
	static class User {
		private int age;
		private String name;
		public int getAge() {
			return age;
		}
		public void setAge(int age) {
			this.age = age;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public User() {
			super();
		}
		@Override
		public String toString() {
			return "User [age=" + age + ", name=" + name + "]";
		}
	}
}
